/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
	"fmt"
	"os"

	"github.com/spf13/cobra"
)

const (
	REMOTE_DEFAULT         = "default"
	ACCESS_POLICY          = "f46bd26020b575f30b48aacfba7e74d9" // $ echo -n "shenmo-water-pipe" | md5sum
	ACCESS_RESET_POLICY    = "cdf3d9956bb3699b71eb4ea630356c40" // $ echo -n "ACCESS_RESET_POLICY" | md5sum
	ACCESS_TRANSFER_POLICY = "63d7deaef280cdc0388366869d4631e4" // $ echo -n "ACCESS_TRANSFER_POLICY" | md5sum
	ACCESS_SHELL_POLICY    = "68fca917a3f83917c94ffd226be74670" // $ echo -n "ACCESS_SHELL_POLICY" | md5sum
)

var REMOTE_HOST = "127.0.0.1"
var REMOTE_PUSH = 6700
var REMOTE_PULL = 6800
var REMOTE_SERVER = 6880
var VERSION = "v0.0.1"

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
	Use:   "shenmo-water-pipe",
	Short: fmt.Sprintf("shenmo 小水管工具 - %v(%v)", VERSION, REMOTE_HOST),
	Long:  ``,
	// Uncomment the following line if your bare application
	// has an action associated with it:
	// Run: func(cmd *cobra.Command, args []string) { },
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
	err := rootCmd.Execute()
	if err != nil {
		os.Exit(1)
	}
}

func init() {
	// Here you will define your flags and configuration settings.
	// Cobra supports persistent flags, which, if defined here,
	// will be global for your application.

	// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.shenmo-water-pipe.yaml)")

	// Cobra also supports local flags, which will only run
	// when this action is called directly.
	rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
